import request from '@/utils/request'

// 查询地区层级列表
export function listTerritory(query) {
    return request({
        url: '/cms/manager/territory/trees',
        method: 'get',
        params: query
    })
}

// 查询地区层级详细
export function getTerritory(id) {
    return request({
        url: '/cms/manager/territory/' + id,
        method: 'get'
    })
}

// 新增地区层级
export function addTerritory(data) {
    return request({
        url: '/cms/manager/territory',
        method: 'post',
        data: data
    })
}

// 修改地区层级
export function updateTerritory(data) {
    return request({
        url: '/cms/manager/territory',
        method: 'put',
        data: data
    })
}

// 删除地区层级
export function delTerritory(id) {
    return request({
        url: '/cms/manager/territory/' + id,
        method: 'delete'
    })
}
